ci: normalize text line endings so Biome passes on Windows#349
Conversation
frontend Biome enforces lineEnding lf, but without repository-owned line-ending rules a Windows clone (core.autocrlf=true default) checks text files out as CRLF — pnpm check fails with 84 formatting errors that are pure CR removals while the identical tree is green on Linux. Add a root .gitattributes: '* text=auto eol=lf' (Git keeps auto-detecting binaries; detected text is pinned to LF in every working tree regardless of each contributor's autocrlf), plus explicit binary markers for image and font assets. Renormalize the six files that had CRLF committed in the repository itself (.github/pull_request_template.md, .gitignore, CODE_OF_CONDUCT.md, LICENSE, docker-compose.yml, frontend/Dockerfile) — every hunk is a line-ending rewrite, no content changes. Closes Abhash-Chakraborty#336
PR Context Summary
Suggested issue links
Use |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughAdds repository-wide LF line-ending rules, preserves binary assets, documents Windows checkout recovery, and normalizes formatting across documentation, ignore rules, Docker Compose, and the frontend Dockerfile without changing runtime behavior. ChangesLine-ending and formatting normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 34345071 | Triggered | Generic Password | 8e7ab62 | docker-compose.yml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
ApprovabilityVerdict: Approved Pure CI/tooling change that adds You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Pull request overview
This PR makes the repository’s line-ending behavior consistent across platforms so frontend Biome formatting checks don’t fail on Windows checkouts that default to CRLF, while keeping binary assets safe from any text conversion.
Changes:
- Add a root
.gitattributesthat normalizes all detected text files to LF on checkout (* text=auto eol=lf) and explicitly marks common repo binary asset extensions asbinary. - Renormalize a small set of previously-CRLF-committed files to LF (license/docs/templates/compose/Dockerfile) without semantic changes.
- Document a one-time re-checkout/reset command in
CONTRIBUTING.mdfor existing Windows clones predating.gitattributes.
Reviewed changes
Copilot reviewed 2 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.gitattributes |
Enforces LF line endings for text files across platforms; marks key asset extensions as binary to prevent conversion. |
CONTRIBUTING.md |
Adds Windows-specific guidance for fixing pre-existing CRLF checkouts after introducing .gitattributes. |
frontend/Dockerfile |
Renormalized to LF line endings (no functional changes). |
docker-compose.yml |
Renormalized to LF line endings (no functional changes). |
LICENSE |
Renormalized to LF line endings (no content changes). |
CODE_OF_CONDUCT.md |
Renormalized to LF line endings (no content changes). |
.gitignore |
Renormalized to LF line endings (no content changes). |
.github/pull_request_template.md |
Renormalized to LF line endings (no content changes). |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CONTRIBUTING.md`:
- Around line 161-168: Update the warning preceding the recovery command in
CONTRIBUTING.md to explicitly state that it discards both staged and unstaged
tracked changes, and adjust the stash/commit guidance accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3cb457e1-6603-4743-9c2b-3e19f43b8b48
📒 Files selected for processing (8)
.gitattributes.github/pull_request_template.md.gitignoreCODE_OF_CONDUCT.mdCONTRIBUTING.mdLICENSEdocker-compose.ymlfrontend/Dockerfile
Dismissing prior approval to re-evaluate 03867e6
Dismissing prior approval to re-evaluate 03867e6
Dismissing prior approval to re-evaluate 03867e6
|
@macroscope-app review Please review this PR against its linked issue, local-first privacy rules, and the current Find repo instructions. |
Abhash-Chakraborty
left a comment
There was a problem hiding this comment.
Looks good to me. The change is focused, the Windows line-ending issue is properly handled, and the review feedback is addressed.
Dismissing prior approval to re-evaluate c077310
|
Note on the GitGuardian flag: it's a false positive. The flagged "secret" is |
Closes #336
Reproduced
Fresh clone on Windows 11 (
core.autocrlf=true, the Git-for-Windows default):pnpm exec biome check .→ 84 errors across 85 files, every hunk a pure␍removal — matching the issue's evidence, while the same tree is green on Linux.Change
.gitattributes—* text=auto eol=lf: Git keeps auto-detecting binaries, and every detected text file is pinned to LF in the working tree on all platforms, so checkouts no longer depend on each contributor'sautocrlf. Explicitbinarymarkers for the image/font asset types present in the repo (png/webp/ico/icns/woff/woff2) as a safety net.git add --renormalize .): the PR template,.gitignore,CODE_OF_CONDUCT.md,LICENSE,docker-compose.yml,frontend/Dockerfile. Verified every diff is a symmetric line-ending rewrite (equal insertions/deletions, no content changes). Nothing else in the repo needed it..gitattributes(git rm -rf --cached . && git reset --hard, with a stash-first warning).Verified on Windows (per the acceptance criteria)
Ran the documented reset on this clone, then:
biome check .→ 0 errors (only the 35 warnings Linux CI also has), exit 0git diff --check→ clean;git status→ no phantom modifications after re-checkoutLICENSEandfrontend/src/app/layout.tsxbytes: LF only.png/.webp/.icoin the renormalize set)Linux behavior is unchanged: committed content was already LF everywhere except the six renormalized files, and
eol=lfmatches what Linux checkouts already produced.Summary by CodeRabbit
Chores
Documentation
Note on the GitGuardian flag
The "Generic Password" it detects is
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-find123}indocker-compose.yml— the pre-existing local-dev default that has been onmainall along. This PR only rewrote that file's line endings (CRLF→LF, no content change), which made the scanner re-attribute every line to this diff. Nothing new is introduced; if you'd like the default fallback removed, that's a separate change I'm happy to make.